package eteam.aps.systeminterface.service;

import eteam.aps.common.QueryResult;
import eteam.aps.common.R;
import eteam.aps.common.exceptions.AuthException;
import eteam.aps.systeminterface.model.dto.LogDto;
import eteam.aps.systeminterface.model.entity.LogEntity;
import eteam.aps.systeminterface.model.reqparam.IdParam;
import eteam.aps.systeminterface.model.reqparam.IdsParam;
import eteam.aps.systeminterface.model.reqparam.QueryLogParam;
import org.apache.ibatis.annotations.Insert;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 日志服务
 */
public interface ILogController {
    /**
     * 分页查询日志
     *
     * @param requestDto
     * @return
     */
    @GetMapping(value = "/api/log/querylogpagelist")
    R<QueryResult<LogEntity>> queryLogPageList(@Validated QueryLogParam requestDto) throws Exception, AuthException;

    /**
     * 记录日志
     *
     * @param logDto: 日志对象
     * @return
     */
    @PostMapping(value = "/api/log/createlog")
    public R createLog(@Validated(Insert.class) @RequestBody LogDto logDto) throws Exception, AuthException;

    /**
     * 删除日志
     *
     * @param idParam
     * @return
     */
    @PostMapping(value = "/api/log/deletelogbyid")
    R deleteLogById(@RequestBody IdParam idParam) throws Exception, AuthException;

    /**
     * 批量删除日志
     *
     * @param idsParam
     * @return
     */
    @PostMapping(value = "/api/log/deletelogbyids")
    R deleteLogByIds(@RequestBody IdsParam idsParam) throws Exception, AuthException;
}
